
#define SERVICE_HMI_CALL_GENERAL						 	  0
#define SERVICE_HMI_CALL_DISPLAY							  1
#define SERVICE_HMI_CALL_KEYBOARD							  2
#define SERVICE_HMI_CALL_PRINTER							  3

//#define SERVICE_HMI_CALL_SMARTCARD						  4
//#define SERVICE_HMI_CALL_MAGNETIC							  5

#define HMI_OPEN						0
#define HMI_CLOSE						1
#define HMI_LIGHT						2
#define HMI_BEEP						3
#define HMI_TESTALL						4
#define HMIK_OPEN_KBD					5
#define HMIK_CLOSE_KBD					6
#define HMI_GET_HARDWARE				7

#define HMID_DISP_PRINT				0
#define HMID_DISP_SETFONT				1
#define HMID_DISP_CLEAR				2
#define HMID_MENU						3
#define HMID_AUTOUPDATE				4
#define HMID_UPDATE					5
#define HMID_SETTITTLE					6
#define HMID_GRAPHIC					7
#define HMID_DISP_PRINT4				8
#define HMID_DISP_FRAME				9
#define HMID_DISP_ADJUST				10

#define HMIK_GETKEY						0
#define HMIK_READ						1
#define HMIK_GET_ACCEPTABLE_KEY		2
#define HMIK_ENTRY						3
#define HMIK_ENTRY_FREE				4
#define HMIK_ENTRY_PWD					5

#define HMIP_GETSTATUS					0
#define HMIP_ISOUTPAPER				1
#define HMIP_PRINT						2
#define HMIP_DEBUG						3

/*#define HMIM_OPEN_SWIPE2				0
#define HMIM_OPEN_SWIPE31				1
#define HMIM_CLOSE_SWIPE2				2
#define HMIM_CLOSE_SWIPE31				3
#define HMIM_GETSTATUS					4
#define HMIM_GETTRACK1					5
#define HMIM_GETTRACK2					6
#define HMIM_GETTRACK3					7*/


typedef struct{
	char szTitle[32];
	int bRadioButtons;
	int nDefaultChoice;	
	int nItems;
	//char Itemsy[512];
	char Itemsy[1024];
}hmimenu;

typedef struct{
	unsigned int line;
	unsigned int col;
	char prompt[64];
	unsigned long attrib;
}hmidisplay;

typedef struct{
	uint32			timeout;
	uint32			AcceptedKey;
}hmikeyb;

typedef struct{
	uint32 x;
	uint32 y;
	uint32 width;
	uint32 height;
	uint8 graphic[128];	
}hmi_graphics;

typedef struct{
	unsigned int events;
	unsigned int timeout;
}hmi_ttestall;

typedef struct{
	char buf[100];	
	uint8 min;
	uint8 max;
	uint32 options;
	uint8 timeout;
}hmi_key_entry;

typedef struct{	
	char tittle[100];
	byte buffer[100];
	uint16 len;
}hmi_pdebug;

typedef  struct{
	uint8 ret;
	char buffer[100];
	unsigned int retuint;
	uint8 reserved;
}hmi_retval;\
typedef struct
{
	char tittle[64];
	char prompt1[64];
	unsigned long attrib1;		
	char prompt2[64];
	unsigned long attrib2;	
	char prompt3[64];
	unsigned long attrib3;	
	char prompt4[64];
	unsigned long attrib4;
}hmidisp4_t;

typedef struct{
	byte hmi_id;
	byte hmi_cmd;
	hmi_retval retval;	
	union
	{	
		//display
		int				line;
		char				buffer[100];
		hmidisplay		disp;	
		hmimenu			dpmenu;
		int				mfont;
		int				mbool;
		uint32			mtime;
		hmidisp4_t		mdisp4;
		//keyboard
		hmikeyb			keyb;
		hmi_graphics		mgraph;	
		hmi_ttestall		mttestall;
		hmi_key_entry	mkentry;
		hmi_pdebug 		pdebug;
		uint8			mframe;
	} etat;
	
	
}ST_hmi;


